package com.sskj.mine.ui.activity;


import android.widget.LinearLayout;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.sskj.common.util.ClickUtil;
import com.sskj.lib.RConfig;
import com.sskj.lib.base.BaseActivity;
import com.sskj.mine.R;
import com.sskj.mine.R2;
import com.sskj.mine.bean.AgentDataBean;
import com.sskj.mine.presenter.AgentManagerActivityPresenter;

import butterknife.BindView;

@Route(path = RConfig.MINE_AGENT_MANAGER)//经纪人
public class AgentManagerActivity extends BaseActivity<AgentManagerActivityPresenter> {
    @BindView(R2.id.mine_spread)
    TextView mineSpread;
    @BindView(R2.id.mine_agent_kh)
    TextView mineAgentKh;
    @BindView(R2.id.mine_agent_yj)
    TextView mineAgentYj;
    @BindView(R2.id.llClient)
    LinearLayout llClient;
    @BindView(R2.id.llMoneyDetail)
    LinearLayout llMoneyDetail;

    @Override
    protected int getLayoutResId() {
        return R.layout.app_activity_agent_manager;
    }

    @Override
    public AgentManagerActivityPresenter getPresenter() {
        return new AgentManagerActivityPresenter();
    }

    @Override
    protected void initView() {
        setTitle(getString(R.string.mine_agent_title));
        ClickUtil.click(llClient, () -> {
            ARouter.getInstance().build(RConfig.MINE_MY_CLIENT).navigation();

        });
        ClickUtil.click(llMoneyDetail, () -> {
            ARouter.getInstance().build(RConfig.MINE_COMMISSION).navigation();
        });

        ClickUtil.click(mineSpread, () -> {  // 我的推广
            ARouter.getInstance().build(RConfig.MINE_SPREAD).navigation();
        });

    }

    @Override
    protected void initData() {
        mPresenter.getAgentData();
    }

    public void updataUI(AgentDataBean data) {
        mineAgentKh.setText(data.getLowUsersCount());
        mineAgentYj.setText(data.getCommissionTotal());
    }

    @Override
    public boolean getImmersion() {
        return false;
    }
}
